﻿@model IEnumerable<DAL.Article>
           
@{
    ViewBag.Title = "Accueil";

    System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("fr-FR");
}

<div class="container">
	<h2>@ViewBag.Message</h2>
	<h3>Dernières publications en date : </h3><hr /><br />
    
    @foreach (DAL.Article article in Model)
    { 
        <h3>Posté le @article.Date.ToString("dddd dd MMMM yyyy à HH:mm", culture)</h3><br />
        <h4><a href="/Articles/Details/@article.ID">@article.Title</a> [ <a href="/Categories/Details/@article.Category.ID" id="@article.ID" rel="popover" data-content="@article.Category.Description" data-original-title="Description"> @article.Category.Name </a> ]</h4><br />
        <div class="well">
            @if (article.Content.Length > 255)
            {
                @article.Content.ToString().Substring(0, 255); @:(...)
            }
            else
            {
                @article.Content
            }
        </div><br />
        <br />
        
        <script src="@Url.Content("~/Scripts/bootstrap-transition.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/jquery.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/bootstrap-tooltip.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/bootstrap-popover.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/bootstrap-validation.js")" type="text/javascript"></script>

        <script type="text/javascript">
            $(function () {
                $("#@article.ID").popover({ placement: 'right' });
            });  
        </script> 
    }
</div>
